package routers

import (
	"github.com/gin-gonic/gin"
	swaggerFiles "github.com/swaggo/files" // swagger embed files
	"github.com/swaggo/gin-swagger"        // gin-swagger middleware
	_ "go-server/docs"
	"go-server/middleware"
	"go-server/routers/user"
)

func InitRouters() *gin.Engine {

	r := gin.Default()
	//解决跨域
	r.Use(middleware.Cors())

	//用户路由
	user.User(r)
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	return r
}
